/*     */ package com.zimbra.cs.ldap;
/*     */ 
/*     */ import com.zimbra.common.util.Log;
/*     */ import com.zimbra.common.util.ZimbraLog;
/*     */ import java.util.Map;
/*     */ import java.util.Set;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class SearchLdapOptions
/*     */ {
/*     */   public static final int SIZE_UNLIMITED = 0;
/*  29 */   public static final String[] RETURN_ALL_ATTRS = null;
/*     */   
/*     */ 
/*     */ 
/*     */   private static final int DEFAULT_RESULT_PAGE_SIZE = 1000;
/*     */   
/*     */ 
/*     */ 
/*     */   private String searchBase;
/*     */   
/*     */ 
/*     */   private ZLdapFilter filter;
/*     */   
/*     */ 
/*     */ 
/*     */   public static abstract class SearchLdapVisitor
/*     */   {
/*  46 */     private boolean wantAttrMapOnVisit = true;
/*     */     
/*     */     protected SearchLdapVisitor() {}
/*     */     
/*     */     protected SearchLdapVisitor(boolean wantAttrMapOnVisit)
/*     */     {
/*  52 */       this.wantAttrMapOnVisit = wantAttrMapOnVisit;
/*     */     }
/*     */     
/*     */     public final boolean wantAttrMapOnVisit() {
/*  56 */       return this.wantAttrMapOnVisit;
/*     */     }
/*     */     
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */     public void visit(String dn, Map<String, Object> attrs, IAttributes ldapAttrs)
/*     */       throws SearchLdapOptions.StopIteratingException
/*     */     {
/*  72 */       if (!$assertionsDisabled) throw new AssertionError();
/*  73 */       ZimbraLog.ldap.warn("default implementation of SearchLdapVisitor.visit is invoked");
/*  74 */       throw new SearchLdapOptions.StopIteratingException();
/*     */     }
/*     */     
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */     public void visit(String dn, IAttributes ldapAttrs)
/*     */       throws SearchLdapOptions.StopIteratingException
/*     */     {
/*  90 */       if (!$assertionsDisabled) throw new AssertionError();
/*  91 */       ZimbraLog.ldap.warn("default implementation of SearchLdapVisitor.visit is invoked");
/*  92 */       throw new SearchLdapOptions.StopIteratingException();
/*     */     }
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/* 102 */   private String[] returnAttrs = RETURN_ALL_ATTRS;
/* 103 */   private int maxResults = 0;
/*     */   private Set<String> binaryAttrs;
/* 105 */   private int resultPageSize = 1000;
/*     */   private ZSearchScope searchScope;
/*     */   private SearchLdapVisitor visitor;
/* 108 */   private boolean isUseControl = true;
/* 109 */   private boolean isManageDSAit = false;
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public SearchLdapOptions(String searchbase, String filterStr, String[] returnAttrs, int maxResults, Set<String> binaryAttrs, ZSearchScope searchScope, SearchLdapVisitor visitor)
/*     */     throws LdapException
/*     */   {
/* 117 */     this(searchbase, ZLdapFilterFactory.getInstance().fromFilterString(ZLdapFilterFactory.FilterId.TODO, filterStr), returnAttrs, maxResults, binaryAttrs, searchScope, visitor);
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public SearchLdapOptions(String searchbase, ZLdapFilter filter, String[] returnAttrs, int maxResults, Set<String> binaryAttrs, ZSearchScope searchScope, SearchLdapVisitor visitor)
/*     */   {
/* 126 */     setSearchBase(searchbase);
/* 127 */     setFilter(filter);
/* 128 */     setReturnAttrs(returnAttrs);
/* 129 */     setMaxResults(maxResults);
/* 130 */     setBinaryAttrs(binaryAttrs);
/* 131 */     setSearchScope(searchScope);
/* 132 */     setVisitor(visitor);
/*     */   }
/*     */   
/*     */   public String getSearchBase() {
/* 136 */     return this.searchBase;
/*     */   }
/*     */   
/* 139 */   public ZLdapFilter getFilter() { return this.filter; }
/*     */   
/*     */   public String[] getReturnAttrs()
/*     */   {
/* 143 */     return this.returnAttrs;
/*     */   }
/*     */   
/*     */   public int getMaxResults() {
/* 147 */     return this.maxResults;
/*     */   }
/*     */   
/*     */   public Set<String> getBinaryAttrs() {
/* 151 */     return this.binaryAttrs;
/*     */   }
/*     */   
/*     */   public int getResultPageSize() {
/* 155 */     return this.resultPageSize;
/*     */   }
/*     */   
/*     */   public ZSearchScope getSearchScope() {
/* 159 */     return this.searchScope;
/*     */   }
/*     */   
/*     */   public SearchLdapVisitor getVisitor() {
/* 163 */     return this.visitor;
/*     */   }
/*     */   
/*     */   public void setSearchBase(String searchBase) {
/* 167 */     this.searchBase = searchBase;
/*     */   }
/*     */   
/*     */   public void setFilter(ZLdapFilter filter) {
/* 171 */     this.filter = filter;
/*     */   }
/*     */   
/*     */   public void setReturnAttrs(String[] returnAttrs) {
/* 175 */     this.returnAttrs = returnAttrs;
/*     */   }
/*     */   
/*     */   public void setMaxResults(int maxResults) {
/* 179 */     this.maxResults = maxResults;
/*     */   }
/*     */   
/*     */   public void setBinaryAttrs(Set<String> binaryAttrs) {
/* 183 */     this.binaryAttrs = binaryAttrs;
/*     */   }
/*     */   
/*     */   public void setResultPageSize(int resultPageSize) {
/* 187 */     this.resultPageSize = resultPageSize;
/*     */   }
/*     */   
/*     */   public void setSearchScope(ZSearchScope searchScope) {
/* 191 */     this.searchScope = searchScope;
/*     */   }
/*     */   
/*     */   public void setVisitor(SearchLdapVisitor visitor) {
/* 195 */     this.visitor = visitor;
/*     */   }
/*     */   
/*     */   public boolean isUseControl() {
/* 199 */     return this.isUseControl;
/*     */   }
/*     */   
/*     */   public void setUseControl(boolean isUseControl) {
/* 203 */     this.isUseControl = isUseControl;
/*     */   }
/*     */   
/*     */   public boolean isManageDSAit() {
/* 207 */     return this.isManageDSAit;
/*     */   }
/*     */   
/*     */   public void setManageDSAit(boolean isManageDSAit) {
/* 211 */     this.isManageDSAit = isManageDSAit;
/*     */   }
/*     */   
/*     */   public static class StopIteratingException
/*     */     extends Exception
/*     */   {}
/*     */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/ldap/SearchLdapOptions.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */